package com.worklog.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.worklog.model.Menu;
import com.worklog.service.MenuService;

import tk.mybatis.mapper.entity.Example;
@Service("menuService")
public class MenuServiceImpl extends BaseService<Menu> implements MenuService{

	@Override
	public Menu selectByMenuName(String menuName) {
		Example example = new Example(Menu.class);
		Example.Criteria criteria = example.createCriteria();
		criteria.andEqualTo("name", menuName);
		List<Menu> menuList = selectByExample(example);
		if (menuList.size() > 0) {
			return menuList.get(0);
		}
		return null;
	}

}
